package View;

import java.awt.Color;

import javax.swing.JPanel;

import Controller.Uitloggen;
import Controller.ViewSwitcher;
import Custom.Button;
import Custom.MouseOver;

@SuppressWarnings("serial")
public class PanelMenuBar extends JPanel {
	
	private static PanelMenuBar single;
	
	private Button dashboard = new Button("Dashboard");
	private Button account = new Button("Rekening");
	private Button transaction = new Button("Transactie");
	private Button settings = new Button("Instellingen");
	private Button help = new Button("Help");
	private Button logout = new Button("Uitloggen");
	
	private Color background = new Color(105, 105, 105);
	private Color selectedButtonColor = new Color(95, 95, 95);
	
	private PanelMenuBar() {
		
		setLayout(null);
		setBounds(0, 0, 140, 725);
		setBackground(background);
		
		dashboard.setSize(140, 30);
		dashboard.setLocation(0, 0);
		dashboard.setBackground(selectedButtonColor);
		dashboard.addMouseListener(new MouseOver(dashboard));
		dashboard.setActionCommand("dashboard");
		dashboard.addActionListener(new ViewSwitcher());
		
		account.setSize(140, 30);
		account.setLocation(0, 60);
		account.addMouseListener(new MouseOver(account));
		account.setActionCommand("account");
		account.addActionListener(new ViewSwitcher());
		
		transaction.setSize(140, 30);
		transaction.setLocation(0, 120);
		transaction.addMouseListener(new MouseOver(transaction));
		transaction.setActionCommand("transaction");
		transaction.addActionListener(new ViewSwitcher());
		
		settings.setSize(140, 30);
		settings.setLocation(0, 180);
		settings.addMouseListener(new MouseOver(settings));
		settings.setActionCommand("settings");
		settings.addActionListener(new ViewSwitcher());
		
		help.setSize(140, 30);
		help.setLocation(0, 240);
		help.addMouseListener(new MouseOver(help));
		help.setActionCommand("help");
		help.addActionListener(new ViewSwitcher());
		
		logout.setSize(140, 30);
		logout.setLocation(0, 665);
		logout.addMouseListener(new MouseOver(logout));
		logout.setActionCommand("logout");
		logout.addActionListener(new Uitloggen());
		logout.setForeground(Color.white);
		
		add(dashboard);
		add(account);
		add(transaction);
		add(settings);
		add(help);
		add(logout);
	}
	
	public static PanelMenuBar getInstance() {
		if(single == null){
			single = new PanelMenuBar();
		}
		return single;
	}
	
	public static void selfDestory(){
		single = null;
	}

	public Button getDashboard() {
		return dashboard;
	}

	public void setDashboard(Button dashboard) {
		this.dashboard = dashboard;
	}

	public Button getAccount() {
		return account;
	}

	public void setAccount(Button account) {
		this.account = account;
	}

	public Button getTransaction() {
		return transaction;
	}

	public void setTransaction(Button transaction) {
		this.transaction = transaction;
	}

	public Button getSettings() {
		return settings;
	}

	public void setSettings(Button settings) {
		this.settings = settings;
	}

	public Button getHelp() {
		return help;
	}

	public void setHelp(Button help) {
		this.help = help;
	}

	public Button getLogout() {
		return logout;
	}

	public void setLogout(Button logout) {
		this.logout = logout;
	}
	
	
}
